<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>教练列表</title>
    <script src="js/flexible.js"></script>
    <link rel="stylesheet" href="css/flexible.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/vant.css">
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/vue/vue.js"></script>
    <script src="js/vue/axios.js"></script>
    <script src="js/vue/MD5.js"></script>
    <script src="js/vue/vant.js"></script>
    <script src="js/vue/qs.js"></script>
    <style>
        .curriculum_kc .content {
            width: 2.6rem;
        }
        .right_a{
            float: right;
            width: 0.07rem;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="curriculum_list">
        <div class="curriculum_kc" v-for="item in coach" @click="coachDetails(item.id)">
            <template>
                <div class="tx">
                    <img :src="item.Picurl" onerror="this.src='images/tx.png'">
                </div>
                <div class="content" style="margin-top: .15rem;">
                    <div class="name fl">{{item.Sname}}</div>
                    <div class="right_a"><img src="shopping/images/right_icon.png"/></div>
                    <div class="clear h10"></div>
                </div>
                <div class="clear"></div>
            </template>
        </div>
    </div>
</div>
</body>
<script>
var vm=new Vue({
    el: '#app',
    data: {
        vids:'',
        coach:[],
    },
    created(){
        this.getlist()
    },
    methods:{
        //团课数据的获取
        getlist(){
            window.vant.Toast.loading({
                mask: true,
                message: '加载中...'
            });
            const params={
                Sid:this.Sid
            }
            getVs()     
            axios.get('/mobileapi/member/index.php?act=coachList',{params:params}).then(data =>{
                console.log(data.data)
                let { msg, code,user} = data.data
                    if (code !== 200) {
                        this.$message({
                            message: msg,
                            type: 'error'
                        });
                    } else {
                        window.vant.Toast.clear()
                        data=data.data
                        this.coach=data.data
						for(let i in this.coach){
							if(this.coach[i].Picurl==null){
								this.coach[i].Picurl='images/tx.png'
							}
						}
                    }
                }).catch(function (error) { 
                    console.log(error); 
            });
        },
        //预约
        coachDetails(id){
            window.location.href='coachDetails.html?Sid='+id+''
        },
    }
})
</script>
</html>